package com.jiangjiang.eshop.pay.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiangjiang.eshop.pay.dto.PayTransactionDTO;
import com.jiangjiang.eshop.pay.dto.PayTransactionQuery;
import com.jiangjiang.eshop.pay.service.PayTransactionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Jianghaowen
 * @Date 2021/9/30
 * @Description: TODO
 * @Version V1.0
 **/
@Slf4j
@RestController
@RequestMapping("/pay/transaction")
public class PayTransactionController {

    @Autowired
    private PayTransactionService payTransactionService;

    @PostMapping("/queryForPage")
    public Page<PayTransactionDTO> queryForPage(@RequestBody PayTransactionQuery query){
        try {
            return payTransactionService.queryForPage(query);
        }catch (Exception e){
            log.warn("PayTransactionController queryForPage error",e);
        }
        return null;

    }

}
